package com.jeff.tianti.controller.channel;

import com.jeff.tianti.cms.entity.ActivityAlerts;
import com.jeff.tianti.cms.entity.Media;
import com.jeff.tianti.cms.service.ActivityAlertsService;
import com.jeff.tianti.common.PageBean;
import com.jeff.tianti.common.dto.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/channel/activityAlerts")
@CrossOrigin(maxAge = 3600)
public class ActivityAlertsController {//江苏频道_活动快讯模块
    @Autowired
    private ActivityAlertsService activityAlertsService;

    /**
     * @Ceator:liuYI
     * @Describe:广告资讯网首页江苏频道板块，活动快讯内容
     */
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public AjaxResult activityAlertsList(@RequestBody PageBean pageBean) {
        Pageable pageable = new PageRequest(pageBean.getCurrentPage(), pageBean.getPageSize());
        Page<ActivityAlerts> page = activityAlertsService.findAllNodel(pageable);
        return AjaxResult.setSuccessPageDate(page);
    }
}
